class Creature {
protected:
	int hp, power;
public:
	virtual void attack(Creature* p) {};
	virtual void hurted(int power) {};
	virtual void fightBack(Creature* p) {};
};

class Dragon :public Creature {
public:
	virtual void attack(Creature* p) {
		p->hurted(power);
		p->fightBack(this);
	};
	virtual void hurted(int power) {
		hp -= power;
	};
	virtual void fightBack(Creature* p) {
		p->hurted(power / 2);
	};
};